package top.wilbert.collegelink.forum.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import top.wilbert.collegelink.forum.entity.TalkEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.wilbert.collegelink.forum.vo.TalkResponseVo;

import java.util.List;

/**
 * @author Augus
 * @email 2531496343@qq.com
 * @date 2023-02-28 14:34:36
 */
@Mapper
public interface TalkDao extends BaseMapper<TalkEntity> {

    void reduceCommentCount(@Param("talkId") Long talkId);

    List<TalkResponseVo> selectSchoolTalkList(IPage<TalkResponseVo> page, @Param("schoolId") Integer schoolId);

    List<TalkResponseVo> selectTalkListByTalkIds(IPage<TalkResponseVo> page, @Param("talkIds") List<Long> talkIds);

    void addLikeCount(@Param("talkId") Long talkId);

    void reduceLikeCount(@Param("talkId") Long talkId);

    void addViewCount(@Param("talkId") Long talkId);

    void updateTalkStatus(@Param("talkId") Long talkId, @Param("code") int code);

    List<TalkResponseVo> selectMyDraftTalkList(IPage<TalkResponseVo> page, @Param("userId") Long userId);

    List<TalkResponseVo> selectMyTalkList(IPage<TalkResponseVo> page, @Param("userId") Long userId);

    Long selectUserIdByTalkId(@Param("talkId") Long talkId);
}
